package ac.il.technion.cs236635.project.test;

public class ThreadJob implements Runnable {

	private int delay;

	private boolean stop = false;
	
	public ThreadJob( int delay) {
		this.delay = delay;
	}
	
	@Override
	public void run() {
		while ( delay > 0) {
			if ( stop)
				break;
			try {
				Thread.sleep( 100);
				
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println( delay);
			delay --;
		}
	}

	public void finish( ) {
		stop = true;
	}
}
